import { FlightOption, SimplifiedFlightInfo } from "../../services/apiService";
import { HumanInputMessage } from "./stoppedOperations";

export interface RequestData {
  question: string;
  type: "summary" | "question" | "humanInput" | "reask";
  messageItem?: MessageItem;
  answerId?: string; // 用于 humanInput 类型的请求，表示当前回答的 ID
  metadata: Record<string, any>; // 可选的元数据
}

export interface Chat {
  chatId: string;
  userId: string;
  messageItems: MessageItem[];
  metadata: Record<string, any>;
}

export interface MessageItem {
  id: string;
  type: "question";
  question: string;
  answers: Answer[];
  answer_length: number;
  date: Date;
}

export interface Answer {
  messageItemId: string;
  id: string;
  display: string;
  originalChinese?: string; // 存储中文原文
  think: string;
  metadata: Record<string, any> & { flightInfo?: FlightOption } & { flightList?: FlightOption[] };
  humanInputs: HumanInputMessage[];
  summaries: AnswerSummary[];
  status: "pending" | "completed" | "error";
  date: Date;
}

export interface AnswerSummary {
  messageItemId: string;
  answerId: string;
  id: string;
  display: string;
  originalChinese?: string; // 存储中文原文
  think: string;
  date: Date;
}

export interface FlightState {
  flightInfo: FlightOption;
  flightList: FlightOption[];
}
export interface CopilotProps {
  copilotOpen: boolean;
  setCopilotOpen: (open: boolean) => void;
  setDisplayHtml: (html: string) => void;
  setDisplayProductId: (productId: string) => void;
  currentDisplayType?: "html" | "product" | null;
  setCurrentDisplayType?: (type: "html" | "product" | null) => void;
  setFlightState?: (flightState: FlightState) => void;
}
